
package packhib;

import packhib.HibernateSessionFactory;
import packhib.Utilisateur;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
public class ServicePoste {
	
	
	public void add(Poste poste)
			{
				Session session = HibernateSessionFactory.getSession();
				Transaction tr = session.beginTransaction();
				session.save(poste);
				tr.commit();
			}
			
			public List listPoste()
			{
				Session session = HibernateSessionFactory.getSession();
				session.clear();
				Transaction tr = session.beginTransaction();
				Criteria cri = session.createCriteria(Poste.class);
				List res = cri.list();
				tr.commit();
				
				return res;
			}

		
		
		

	


}
